package testsite4;

public class EnemyUnit {
    
    private String name;
    private int health;
    private int maxHealth;
    private int damage;
    private int level;
    private int EXP;
    private int gold;
    
    public EnemyUnit(String n, int h, int d, int l) {
        
        name = n;
        health = h;
        maxHealth = h;
        damage = d;
        level = l;
        EXP = (int)(Math.random() * (10+level) + (level*10));
        gold = (int)(Math.random() * (5*level) + (level*10));
        
    }
    
    public int Attack() {
        
        return damage;
        
    }
    
    public void Defend(int d) {
        
        health -= d;
        
    }
    
    public void Heal() {
        
        health = maxHealth;
        
    }
    
    public String toString() {
        
        return name + " Hp: " + health + " Dmg: " + damage;
        
    }
    
}
